<template>
  <div>
    <el-form inline>
      <el-form-item label="申请类型">
        <el-select v-model="queryParams.jrProductType">
          <el-option value="1" label="租房分期"></el-option>
          <el-option value="2" label="收房贷"></el-option>
          <el-option value="3" label="应收租约管理"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="申请状态">
        <el-select v-model="queryParams.applyState">
          <el-option value="1" label="未审核"></el-option>
          <el-option value="2" label="初审通过"></el-option>
          <el-option value="3" label="初审未通过"></el-option>
          <el-option value="4" label="复审通过"></el-option>
          <el-option value="5" label="复审未通过"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="查询日期">
        <el-date-picker
          v-model="queryParams.startTime"
          type="datetime"
          placeholder="选择日期时间"
          align="right">
        </el-date-picker>至
        <el-date-picker
          v-model="queryParams.endTime"
          type="datetime"
          placeholder="选择日期时间"
          align="right">
        </el-date-picker>
      </el-form-item>
      <el-button type="primary" @click="financingApplication">查询</el-button>
    </el-form>
    <el-table :data="financingApplicationList" height="500" style="width: 100%">
      <el-table-column label="申请合同号" align="center" prop="applyOrderNo" />
      <el-table-column label="贷款信息" align="center" prop="companyName" />
      <el-table-column label="申请类型" align="center">
        <template slot-scope="scope">
          {{scope.row.jrProductType==1?"租房分期":scope.row.jrProductType==2?"收房贷":"应收租约保理"}}
        </template>
      </el-table-column>
      <el-table-column label="借款金额" align="center" prop="loanAmount" />
      <el-table-column label="借款期限" align="center" prop="monthLimit" />
      <el-table-column label="申请日期" align="center" prop="createTime" />
      <el-table-column label="资金方" align="center" prop="companyName"/>
      <el-table-column label="申请状态" align="center" prop="applyState">
        <template slot-scope="scope">
          {{scope.row.applyState==1?"申请中":scope.row.applyState==2?"初审通过":scope.row.applyState==3?"初审不通过":scope.row.applyState==4?"复审通过":"复审不通过"}}
        </template>
      </el-table-column>
      <el-table-column label="驳回原因" align="center" prop="auditMemo"/>
    </el-table>
    <el-row>
      <el-col align="center">
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="financingApplication"
        />
      </el-col>
    </el-row>
  </div>

</template>
<script>
  import {listFinancing} from "@/api/financial/rentInstall";

  export default {
    name: "RentJnstallList",
    data(){
      return{
        total: 0,
        queryParams:{
          pageNum:1,
          pageSize:10,
        },
        financingApplicationList:[],
      }
    },
    methods:{
      financingApplication(){
        listFinancing(this.queryParams).then(response=>{
          console.log(response)
          if (response.code==200){
            this.financingApplicationList = response.data;
            this.total = response.total;
          }
        })
      },
    },
    created() {
      this.financingApplication();
    }
  }
</script>

<style scoped>

</style>
